package org.lem

class Student extends Person {

  //static searchable = true;

  static hasMany = [studentLearningSkill: StudentLearningSkill,
          studentLearningActivities: StudentLearningActivity, studentPreferences: ScheduledClass]

  Boolean churchMembership
  String nameOfChurch
  Date applicationDate
  Long studentId

  static constraints = {
    studentId()
    applicationDate()
    firstName()
    middleName(nullable: true)
    lastName()
    homeAddress(nullable : true)
    city()
    state()
    zip(nullable: true)
    homePhone(nullable: true)
    cellPhone(nullable: true)
    emailAddress(nullable: true)
    gender(inList: ["Male", "Female", "Not Specified"])
    dateOfBirth(nullable: true) //TODO: fix nullability
    countryOfBirth()
    nativeLanguage(nullable: true) //TODO: fix nullability
    otherLanguages(nullable: true)
    ethnicity()
    churchMembership(nullable: true)
    nameOfChurch(nullable: true)
    inputBy()
    inputDate()
    //studentLearningSkill()
    //studentLearningActivities()
    //studentPreferences() //TODO: make so studentPreferences is not hyperlinked
  }

  String toString() {
    "${studentId} - ${firstName} ${lastName}"
  }
}
